package com.hup.minicontroller.common.bluetooth.framework;

import android.util.Log;

import com.hup.minicontroller.common.bluetooth.model.BaseBtDataPacket;

/**
 * @author hugan
 * @date 2021/5/14
 */
public interface BtChannelHandler {

    void onConnectResult(boolean success, BtChannel channel);

    void onChannelClosed(BtChannel channel);

    /**
     * 收到客户端的未知消息
     */
    default void onUnknownData(BtChannel channel, BaseBtDataPacket data) {
        Log.w(getClass().getSimpleName(), "onUnknownData: 未知数据类型=" + data);
    }

    void exceptionCaught(BtChannel channel, Throwable e);

}
